
package Com;

import java.sql.Connection;
import java.sql.DriverManager;


public class Banco {

/*
 * Classe de Conexao Banco Oracle
 * 
 */

	public Connection Oracle(){
		Connection conn = null;
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
		} catch (Exception e) {
			// TODO: handle exception
		}try {
			conn = DriverManager.getConnection("jdbc:oracle:thin:@10.0.0.111:1521:moldenox","desenvolver","desenvolver");
			System.out.println("Conexao realizada com sucesso !");
		} catch (Exception e) {
			// TODO: handle exception
		}
		return conn;
	}
/*
 * Classe de Conexao Banco SqlServer
 * 	
 */
	
	public Connection SqlServer(){
		Connection conn = null;
		try {
			Class.forName("net.sourceforge.jtds.jdbc.Driver");
		} catch (Exception e) {
			// TODO: handle exception
		}try {
			conn = DriverManager.getConnection("jdbc:jtds:sqlserver://ip:porta/banco","user","password");
			System.out.println("Conectado com sucesso !");
		} catch (Exception e) {
			// TODO: handle exception
		}
		return conn;
	}
/*
 * Classe de Conexao Banco MySql
 * 
 */
	public Connection MySql(){
		Connection conn = null;
		try {
			Class.forName("com.mysql.jdbc.Driver");
		} catch (Exception e) {
			// TODO: handle exception
		}try {
			conn = DriverManager.getConnection("jdbc:mysql//localhost:3306/nomedobanco", "usuario","senha");
			System.out.println("Conectado com sucesso !");
		} catch (Exception e) {
			// TODO: handle exception
		}
		return conn;
	}
	
	
}

